//
//  LovingTutorsTableViewCell.m
//  one_mile_01
//
//  Created by 王雅蓉 on 15/10/26.
//  Copyright © 2015年 王雅蓉. All rights reserved.
//

#import "LovingTutorsTableViewCell.h"

@interface LovingTutorsTableViewCell ()
{
    UIImageView *bgImageView;
    UILabel *aLine;
}

@end

@implementation LovingTutorsTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self createSubviews];
    }
    
    return self;
}

-(void)createSubviews
{
    bgImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, COMMONCELLHEIGHT)];
    bgImageView.image = [UIImage imageNamed:@"kuangjia.png"];
    [self.contentView addSubview:bgImageView];
    
    self.lovingTutorIV = [[UIImageView alloc] initWithFrame:CGRectMake(15, 10, COMMONCELLHEIGHT - 50, COMMONCELLHEIGHT - 50)];
    //self.tutorIV.backgroundColor = [UIColor yellowColor];
    //self.tutorIV.image = [UIImage imageNamed:@"placeholders.png"];
    _lovingTutorIV.layer.masksToBounds = YES;
    _lovingTutorIV.layer.cornerRadius = 40;
    [self.contentView addSubview:_lovingTutorIV];
    
    self.lovingTutorNameL = [[UILabel alloc] initWithFrame:CGRectMake(_lovingTutorIV.frame.origin.x, _lovingTutorIV.frame.origin.y + _lovingTutorIV.frame.size.height, _lovingTutorIV.frame.size.width, 40)];
    self.lovingTutorNameL.text = @"";
    self.lovingTutorNameL.textAlignment = NSTextAlignmentCenter;
    self.lovingTutorNameL.textColor = FONT_ASSISTANT_COLOR;
    self.lovingTutorNameL.font = [UIFont systemFontOfSize:17.0f];
    self.lovingTutorNameL.font = [UIFont boldSystemFontOfSize:17.5f];
    [self.contentView addSubview:_lovingTutorNameL];
    
    //话题
    self.topicForlovingTutorL = [[UILabel alloc] initWithFrame:CGRectMake(_lovingTutorIV.frame.origin.x + _lovingTutorIV.frame.size.width + 15, _lovingTutorIV.frame.origin.y + 5, WIDTH - 10 - _lovingTutorIV.frame.size.width - 40, 42)];
    //self.topicL.backgroundColor = [UIColor yellowColor];
    self.topicForlovingTutorL.numberOfLines = 2;
    self.topicForlovingTutorL.text = @"聊一聊风险投资是怎么一回事";
    [self.contentView addSubview:_topicForlovingTutorL];
    
    self.priceForlovingTutorL = [[UILabel alloc] initWithFrame:CGRectMake(_topicForlovingTutorL.frame.origin.x, _topicForlovingTutorL.frame.origin.y + _topicForlovingTutorL.frame.size.height + 10, _topicForlovingTutorL.frame.size.width - 30, _topicForlovingTutorL.frame.size.height - 25)];
    self.priceForlovingTutorL.textColor = RGBACOLOR(142, 142, 142, 1.0);
    self.priceForlovingTutorL.font = [UIFont systemFontOfSize:15.0f];
    //self.schoolL.backgroundColor = [UIColor yellowColor];
    [self.contentView addSubview:_priceForlovingTutorL];
    
    aLine = [[UILabel alloc] initWithFrame:CGRectMake(_priceForlovingTutorL.frame.origin.x, _priceForlovingTutorL.frame.origin.y + _priceForlovingTutorL.frame.size.height + 5, _topicForlovingTutorL.frame.size.width + 10, 1)];
    aLine.backgroundColor = RGBACOLOR(221, 221, 221, 1.0);
    [self.contentView addSubview:aLine];
    
    self.stateForlovingTutorL = [[UILabel alloc] initWithFrame:CGRectMake(aLine.frame.origin.x + 5, _lovingTutorNameL.frame.origin.y - 2, _topicForlovingTutorL.frame.size.width, _lovingTutorNameL.frame.size.height)];
    self.stateForlovingTutorL.textColor = FONT_DARKGREY_COLOR;
    self.stateForlovingTutorL.font = [UIFont systemFontOfSize:12.0f];
    //self.stateForlovingTutorL.font = [UIFont boldSystemFontOfSize:12.0f];
    [self.contentView addSubview:_stateForlovingTutorL];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
